import { notification } from "ant-design-vue"

export const useNotice = (type) => ({
        message,
        description,
        duration = 1.5, //默认 4.5 秒后自动关闭，配置为 null 则不自动关闭
    }) => {
        notification[type]({
            message,
            description,
            duration
        })
    }
    //配合高阶函数封装四个方法
export const useSuccessNotice = useNotice("success")
export const useInfoNotice = useNotice("info")
export const useWarningNotice = useNotice("warning")
export const useErrorNotice = useNotice("error")